package com.fisherman.test;

import com.fisherman.aop.MathCalculator;
import com.fisherman.config.MainConfigOfAop;
import com.fisherman.ext.ExtConfig;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @User: fisherman
 * @Date: 2020/5/20 11:20
 */
public class IOCTest_Tex {

    @Test
    public void test() {
        //1.创建ioc容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ExtConfig.class);

        //发布了一个事件
        applicationContext.publishEvent(new ApplicationEvent(new String("我发布时间")) {
        });

        //关闭容器
        applicationContext.close();
    }
}
